package com.broada.apm.processor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;

import com.broada.apm.service.SystemService;

public class BeanPostProcessor implements ApplicationListener<ContextRefreshedEvent> {

	@Autowired
	public SystemService systemService;
	
	@Override
	public void onApplicationEvent(ContextRefreshedEvent event) {
		if(event.getApplicationContext().getParent() == null){
			systemService.querySystemInfo();
	      }
	}

}
